export default {

    ADDCART(state, product) {
     state.cartList.push(product);
    },
    ADDCOUNT(state,product)
    {
        product.num++
     
    },
    ADDCOLLECT(state,collect)
    {
        state.collectList.push(collect);
 
    },
    CHANGECHECKED(state,cart)
    {
      cart.checked=!cart.checked
    },
    DELETEPRO(state,cartIndex){
        state.cartList.splice(cartIndex, 1); 
    },
    DELETECOLLECT(state,cartIndex){
        state.collectList.splice(cartIndex, 1); 
       
    },
    DELETNUM(state,cart)
    {
        cart.num--
    },DELETEALL(state){
        state.cartList=[]

    },
    CHANGEALL(state,allChecked){

        state.cartList.map(item=>item.checked=allChecked)
    }


};
